home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 3 / Info_Mac_1994-01.iso / Print / LaserWriter 8.x Hacks 1.1 < prev    next >
Text File  |  1993-12-30  |  16KB  |  364 lines

  1. Subject: [*] LaserWriter 8.x Hacks & Patches, version 1.1
  2. Date: Tue, 07 Dec 93 11:40:16 EST
  3. From: Don Markuson <dmm@tiger1.CV.COM>
  4.  
  5.  
  6. Enclosed is a brief report on hacks and patches folks can make to the
  7. LaserWriter 8.x driver to tailor it better to their needs or environment.
  8. It covers how to:
  9.  
  10.   - Make the SETUP button in the Chooser always active
  11.   - Disable the AppleTalk requirement (use to only generate PS files)
  12.   - Select N-up choices from the Print Dialog
  13.   - Modify N-up choices for additional/other layouts
  14.   - Disable N-up page borders
  15.   - Modify which fonts are included in PS files
  16.   - Disallow printing of multiple copies
  17.   - Avoid unnecessary use of the Symbol font for certain symbols
  18.  
  19. ..Don Markuson
  20.   dmm@tiger1.cv.com
  21.  
  22. --------------Cut Here-------------
  23.  
  24. Patches YOU can make to LaserWriter 8.x.               DMM  Rev. 1.1  07-Dec-93
  25.  
  26. Supplementing Ric Ford's 28-Jun-93 MacWeek MacInTouch column on patches to the
  27. LaserWriter 8 driver, here's some more info based on my own experimentation
  28. with thanks to Ric and his sources.  All require using ResEdit or equivalent,
  29. however some have been incorporated into a new freeware tool called "Printer
  30. Defaults" by John Rawnsley, which is intended to replace the aging MyPageSetup.
  31. Look for rev 1.1.1 or later at standard archive sites.
  32.  
  33.  
  34. ALWAYS MAKE A BACKUP COPY OF THE DRIVER BEFORE MONKEYING WITH IT USING RESEDIT!
  35.  
  36.  
  37. 1)  MAKE SETUP BUTTON IN CHOOSER ALWAYS ACTIVE
  38.  
  39.     To make the Setup button in the Chooser always active (i.e., so it works
  40.     even when AppleTalk is disabled or you have no PostScript printers on the
  41.     network):
  42.  
  43.     In ResEdit, open the nrct resources by double-clicking on their icon, then
  44.     double-click on nrct -4096.  Change the second rectangle from 0,0,0,0 to
  45.     match the first rectangle (112,178,132,255 in US versions of LW 8).  Then
  46.     change the first rectangle to 9999,9999,9999,9999.  (If you change the
  47.     first to 0,0,0,0, you'll get a strange-looking circle in some weird place
  48.     in the Chooser window because this button is outlined.)
  49.  
  50.     You've now enabled the Setup button that's always active and disabled the
  51.     one that stays grayed out until a configurable printer shows up in your
  52.     network.
  53.  
  54.  
  55. 2)  DISABLE APPLETALK REQUIREMENT
  56.  
  57.     To patch driver not to require AppleTalk (e.g., so you can use it in PS
  58.     file generation mode when not on a network):
  59.  
  60.     Open the PACK resources by double-clicking, then double-click on the PACK
  61.     -4096 resource to open it (using the Hex Editor).  Change the byte at
  62.     offset 000C from "ED" to "6D".  This works best in combination with the
  63.     nrct patch discussed above to activate the Setup button in the Chooser at
  64.     all times.
  65.  
  66.     Fortunately, there's no longer a need to patch the driver to always
  67.     generate a PS file, since the choice to generate PS files in the Print
  68.     dialog is now "sticky".
  69.  
  70.     Once you've saved this change and exited ResEdit, you need to "flush the
  71.     Chooser's cache" for this change to be noticed:  remove all LaserWriter 8
  72.     variants from the Extensions and/or System Folder (e.g. move them onto the
  73.     desktop), open the Chooser, close the Chooser, and finally put your LW 8
  74.     variants back.
  75.  
  76.     !! WARNING !!  A LaserWriter driver crippled in this manner will no longer
  77.     !! WARNING !!  see printers on an AppleTalk network (LocalTalk -or-
  78.     !! WARNING !!  EtherTalk).  This patch is intended only for those who have
  79.     !! WARNING !!  no such network and want to just generate PS files.  If
  80.     !! WARNING !!  you're a portable Mac user and move between a networked and
  81.     !! WARNING !!  non-networked environment, keep two copies of the LW driver,
  82.     !! WARNING !!  one patched to avoid AppleTalk and the other regular.
  83.  
  84.  
  85. 3)  SELECT N-UP FROM PRINT DIALOG
  86.  
  87.     To allow N-up choices directly within the Print Dialog (in addition to
  88.     Page Setup):
  89.  
  90.     The DITL -8191 resource includes an N-up pull-down menu way off the right
  91.     side of the dialog.  To pull it in, open the DITL resources by double-
  92.     clicking on their icon, then JUST SELECT (click once) on DITL -8191.
  93.     Pull down "Open Using Template..." from ResEdit's Resource menu, and use
  94.     the "DITL" template (which should be the default choice).  Scroll to the
  95.     bottom of the list to item 31, which should look something like:
  96.  
  97.     31) *****
  98.         Display rect: 46   600   63   770
  99.         Item type:    $07
  100.         Item info:    <some binary bytes>
  101.  
  102.     Change the display rect to something inside the visible dialog area; I
  103.     used:
  104.  
  105.         Display rect: 46   110   63   280
  106.  
  107.     Do NOT click on the "Set" button to the right of this entry; simply close
  108.     the window to make the change.
  109.  
  110.     This places the N-up pull-down just below "Pages:" in the Print dialog.
  111.     The N-up setting for the document can be changed using either this
  112.     control or the one in Page Setup; once you change it, that setting
  113.     is retained and will be the default for the next time Page Setup or Print
  114.     are used.
  115.  
  116.     (I've been told the above placement for this control isn't the best choice
  117.     if you've got a printer which supports PostScript FAX, since a FAX radio
  118.     button appears in this area of the Print dialog.  Another strategy would
  119.     be to move Item 30 off-screen (it seems to be simply a status field which
  120.     reiterates the N-up setting when greater than 1), and then move the N-up
  121.     pull down control into the lower left area of the dialog where this field
  122.     used to be.  Item 21, the outline surrounding the "Paper Source" area of
  123.     the dialog must have its height shrunk in order to allow mouse clicks to
  124.     reach the N-up pull-down.  Feel free to experiment.)
  125.  
  126.  
  127. 4)  MODIFY N-UP CHOICES
  128.  
  129.     To modify the N-up dialog to alter or add other organizations you might
  130.     desire instead of the 1-, 2-, and 4-up organizations provided:
  131.  
  132.     Up to 8 choices, or N-up menu items, are allowed (including 1-up, which
  133.     should not be modified).  Open the MENU resources by double-clicking on
  134.     their icon, then double-click on MENU -8185.  Clicking to select a menu
  135.     item allows you to change the text of that entry.  You can also alter
  136.     its text style using the Style menu which appears when MENU items are
  137.     opened.  I don't recommend changing any other attributes.  To add another
  138.     choice to the list, select "Create New Resource" from ResEdit's Resource
  139.     menu.
  140.  
  141.     The corresponding specification for each N-up layout is in the NPLY -8192
  142.     resource.  This resource consists of x-1 groups of 3 longwords (12 bytes),
  143.     where x is the number of N-up choices (subtracting one because 1-up is not
  144.     represented in this resource).  The 3 longwords are:
  145.  
  146.         1.  0 = portrait, 1 = landscape orientation of layout on paper
  147.         2.  the number of columns in the layout
  148.         3.  the number of rows in the layout
  149.  
  150.     and each one corresponds to its positional location in the MENU resource
  151.     (excepting 1-up, of course).  The original MENU -8185 and corresponding
  152.     NPLY -8192 are: 
  153.  
  154.         MENU choice         Landscape   # columns    # rows
  155.         -----------         ---------   ---------   ---------
  156.            1-up             (not represented in NPLY)
  157.            2-up             0000 0001   0000 0002   0000 0001
  158.            4-up             0000 0000   0000 0002   0000 0002
  159.  
  160.     Others you could add:
  161.  
  162.            6-up             0000 0001   0000 0003   0000 0002
  163.            8-up             0000 0001   0000 0004   0000 0002
  164.            9-up             0000 0000   0000 0003   0000 0003
  165.           16-up             0000 0000   0000 0004   0000 0004
  166.         1000-up (!)         0000 0001   0000 0028   0000 0019
  167.  
  168.     If everything is done properly, the visual effect of N-up in the Page
  169.     Setup dialog should work correctly for the choices you've added or changed.
  170.  
  171.  
  172. 5)  DISABLE N-UP BORDERS
  173.  
  174.     Starting at LaserWriter version 8.1.1, it's particularly easy:  Open the
  175.     PRFS resources by double-clicking on their icon, then double-click on PRFS
  176.     -8192.  You should be presented with a nice template of yes/no choices.
  177.     Change the one labelled "Don't frame n-up pages" from 0 to 1.  (I'm not
  178.     altogether clear on what the other options do.)
  179.  
  180.     For earlier revs of LaserWriter 8.x, open the PS resources by double-
  181.     clicking, then double-click on the PS -8184 resource to open it (using the
  182.     Hex Editor).  Change the byte at offset 04EB from 0D (carriage-return) to
  183.     25 ('%' PS comment character).  [In LW 8.1.1, the offset is 051C, but above
  184.     method is much nicer.]
  185.  
  186.  
  187. 6)  MODIFY WHICH FONTS ARE INCLUDED IS PS FILES
  188.  
  189.     The resource which contains the list of Excludable Fonts is STR# -8174,
  190.     and MENU -8180 is where the "All But Standard 13" text is kept.  Let's say
  191.     you wanted to make this "All But Standard 35", excluding the LaserWriter
  192.     Plus set of fonts.  Here's what to do:
  193.  
  194.     Open MENU items by double-clicking on their icon, then double-click on MENU
  195.     -8180 to open it (you may have to scroll to see it).  Select the "All But
  196.     Standard 13" item and change the "13" to "35" in the Text box on the right.
  197.  
  198.     It turns out the pull-down control for this selection is only wide enough
  199.     to accommodate "All But Standard 13" and can't handle the slightly wider
  200.     "35".  To correct this, double-click your way to open the CNTL -8180
  201.     resource.  Increase its width slightly by changing the rightmost number
  202.     from 257 to 265.
  203.  
  204.     Similarly, double-click your way to open STR# -8174.  To add new entries,
  205.     scoot to the bottom and click on the "14) *****" text; an outline should
  206.     appear.  Pull down "Insert New Field(s)" from the Resource menu (or type
  207.     it shortcut, Command-K).  Do this 22 times (35 - 13) to insert enough blank
  208.     entries, then fill them in with the following LaserWriter Plus font names:
  209.  
  210.        AvantGarde-Book
  211.        AvantGarde-BookOblique
  212.        AvantGarde-Demi
  213.        AvantGarde-DemiOblique
  214.        Bookman-Light
  215.        Bookman-LightItalic
  216.        Bookman-Demi
  217.        Bookman-DemiItalic
  218.        Helvetica-Narrow
  219.        Helvetica-Narrow-Oblique
  220.        Helvetica-Narrow-Bold
  221.        Helvetica-Narrow-BoldOblique
  222.        NewCenturySchlbk-Roman
  223.        NewCenturySchlbk-Italic
  224.        NewCenturySchlbk-Bold
  225.        NewCenturySchlbk-BoldItalic
  226.        Palatino-Roman
  227.        Palatino-Italic
  228.        Palatino-Bold
  229.        Palatino-BoldItalic
  230.        ZapfChancery-MediumItalic
  231.        ZapfDingbats
  232.  
  233.     An alternative to this method is to use Hugo Ayala's handy shareware
  234.     Trimmer control panel, which continues to work with LaserWriter 8.x as it
  235.     has with LaserWriter 7.x.  This tool lists your installed fonts and easily
  236.     lets you select which ones are to be included.  (Its checkbox to Include
  237.     LaserWriter Header has no meaning with LW 8.x.)
  238.  
  239.  
  240. 7)  DISALLOW PRINTING MULTIPLE COPIES
  241.  
  242.     Here's what to do to prevent users from (easily) printing multiple copies
  243.     using LW8.  (Users can, of course, print their document more than once, and
  244.     if they're going to do this, it's *much* more efficient on network band-
  245.     width and printer availability to allow them to specify multiple copies in
  246.     the LW driver):
  247.  
  248.     Open the DITL resources by double-clicking on their icon, then double-click
  249.     on DITL -8191.  Double-click on the boxed field where the number of copies
  250.     would be entered (item #10, it should appear with a "1" in it).  Change its
  251.     type from "Edit Text" to "Static Text" using the pull down menu that should
  252.     appear.
  253.  
  254.     This turns out to be all that's needed.  However to make it a bit harder
  255.     for a bright user to defeat, make the following minor mod as well, so even
  256.     if they figure how to specify >1 copy, the PostScript code will ignore it:
  257.  
  258.     Open the STRI resources by double-clicking on their icon, then double-click
  259.     on STRI -8188 to open it using the Hex Editor.  Pull down "Find ASCII" from
  260.     the Find menu.  Find ASCII "/copies ^d def copies setcopies"
  261.                     Change To: "^d pop/copies 1 def 1 setcopies"
  262.  
  263.  
  264. 8)  AVOID UNNECESSARY USE OF Symbol FONT
  265.  
  266.     LaserWriter drivers since the early days have relied upon the Symbol font
  267.     for printing the following symbols from the upper half of Apple's standard
  268.     roman font encoding:
  269.                                 LW7    LW8   Unnecessarily
  270.         Encoding  Character     Sub?   Sub?   Substituted
  271.         --------  ------------  ----   ----  -------------
  272.            A1     degree          *      *         *
  273.            A8     registered      *                *     
  274.            A9     copyright       *                *
  275.            AA     trademark       *                *
  276.            AD     notequal        *      *
  277.            B0     infinity        *      *
  278.            B1     plusminus       *      *         *
  279.            B2     lessequal       *      *
  280.            B3     greaterequal    *      *
  281.            B5     mu              *      *         *
  282.            B6     partialdiff     *      *
  283.            B7     Sigma           *      *
  284.            B8     Pi              *      *
  285.            B9     pi              *      *
  286.            BA     integral        *      *
  287.            BD     Omega           *      *
  288.            C2     logicalnot      *                *
  289.            C3     radical         *      *
  290.            C5     approxequal     *      *
  291.            C6     Delta           *      *
  292.            D6     divide          *                *
  293.            D7     lozenge         *      *
  294.            E0     applelogo       *      *
  295.  
  296.     [LaserWriter 7.x used LW7 Sub? list for resident (ROM-based) fonts and
  297.     LW8 Sub? list for downloaded fonts (PostScript or TrueType).]
  298.  
  299.     Because of this substitution, these symbols will not print with attributes
  300.     like bold or italics (even if they appear that way on-screen).  If you've
  301.     got a relatively recent printer (certainly any PS Level 2 printer), then
  302.     you can alter the LaserWriter driver to not switch to the Symbol font for
  303.     the unnecessarily substituted symbols above.
  304.  
  305.     In LaserWriter 8.x, the mapping table is in resource encM -8192; open it
  306.     by double-clicking your way into it.  It is a table of byte values indexed
  307.     by Mac character encoding values starting at hex A0, so the first byte in
  308.     the table corresponds to character encoding A0.  If the corresponding byte
  309.     in the table is non-zero, it represents that character's substitute
  310.     encoding in the Symbol font.  Change the bytes at the following offsets to
  311.     00 in order to prevent unnecessary substitutions:
  312.  
  313.        Offset  From   To
  314.        ------  ---- ----
  315.         0001   B0 --> 00
  316.         0011   B1 --> 00
  317.         0015   6D --> 00
  318.         0036   B8 --> 00
  319.     
  320.  
  321. To save your changes in ResEdit, simply quit ResEdit, answering "Yes" to the
  322. inevitable question about whether you really want to save your changes.
  323.  
  324.  
  325. Patches still being sought:
  326.  
  327.   - Allow PostScript file generation to be backgrounded.  It is presently
  328.     crippled to work only in foreground for consistency with the EPS-with-
  329.     Preview modes which can't be backgrounded because of the Preview.
  330.  
  331.  
  332. Grateful acknowledgements go to the following folks for their inputs:
  333.  
  334.   - Dennis Chesters, who prompted me to investigate the Symbol font funniness.
  335.   - John Kalucki, who sent me some interesting N-up hacks that are too
  336.     specialized to include here.
  337.   - Edgar Knapp, who suggested a suitable warning accompany hack #2.
  338.   - Mike McDuffie, who incorporated some of these into a ResCompare patcher.
  339.   - John Rawnsley, who brought the LW 8.1.1 PRFS resource to my attention, and
  340.     took it upon himself to update the aging and sometimes cranky MyPageSetup
  341.     tool with his recent freeware "Printer Defaults", which as a bonus also
  342.     allows you to incorporate some of the above hacks (or remove them).
  343.  
  344. And special thanks go to:
  345.  
  346.   - Richard Blanchard, who helped design and build LaserWriter 8, for sneaking
  347.     many of the hooks needed for these patches into LW 8 knowing there are
  348.     folks out there like you and me who might want to exploit them!
  349.  
  350.   - Ric Ford, who courageously publicizes and investigates Mac problems, then
  351.     vents our collective frustrations to Apple in a way that's both helpful
  352.     and entertaining.  I never miss his MacInTouch column in MacLeak!
  353.  
  354.  
  355. Happy hacking!
  356.  
  357. ..Don Markuson
  358.   Computervision Corp.
  359.   201 Burlington Road
  360.   Bedford, MA  01730
  361.   <dmm@tiger1.cv.com> or
  362.   <d.markuson@ieee.org>
  363.  
  364.